// @/api/order.js
//我的订单


import request from '@/utils/request';

export function getOrderList(pageNum, pageSize) {
  return request({
    url: '/order/list',// 获取订单列表，替换本地接口地址
    method: 'post',
    data: {
      pageNum,
      pageSize
    }
  });
}

// 获取各个菜单项的数据
export function getMenuData(menuIndex) {
  const urlMap = {
    profile: '/menu/profile',
    messages: '/menu/messages',
    account: '/menu/account',
    address: '/menu/address',
    security: '/menu/security',
    points: '/menu/points',
    favorites: '/menu/favorites',
    footprints: '/menu/footprints',
    transactions: '/menu/transactions',
    orders: '/menu/orders',
    coupons: '/menu/coupons',
    giftcards: '/menu/giftcards',
    service: '/menu/service',
    returns: '/menu/returns',
    help: '/menu/help'
  };

  const url = urlMap[menuIndex];
  if (!url) {
    return Promise.reject(new Error('Invalid menu index'));
  }

  return request({
    url,
    method: 'get'
  });
}